<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="security.role_hierarchy.roles" type="collection" />
    </parameters>

    <services>
        <defaults public="false" />

        <service id="security.authorization_checker" class="Symfony\Component\Security\Core\Authorization\AuthorizationChecker" public="true">
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="security.authentication.manager" />
            <argument type="service" id="security.access.decision_manager" />
            <argument>%security.access.always_authenticate_before_granting%</argument>
        </service>
        <service id="Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface" alias="security.authorization_checker" />

        <service id="security.token_storage" class="Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage" public="true">
            <tag name="kernel.reset" method="disableUsageTracking" />
            <tag name="kernel.reset" method="setToken" />
            <argument type="service" id="security.untracked_token_storage" />
            <argument type="service_locator">
                <argument key="session" type="service" id="session" />
            </argument>
        </service>
        <service id="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface" alias="security.token_storage" />

        <service id="security.untracked_token_storage" class="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage" />

        <service id="security.helper" class="Symfony\Component\Security\Core\Security">
            <argument type="service_locator">
                <argument key="security.token_storage" type="service" id="security.token_storage" />
                <argument key="security.authorization_checker" type="service" id="security.authorization_checker" />
            </argument>
        </service>
        <service id="Symfony\Component\Security\Core\Security" alias="security.helper" />

        <service id="security.user_value_resolver" class="Symfony\Component\Security\Http\Controller\UserValueResolver">
            <argument type="service" id="security.token_storage" />
            <tag name="controller.argument_value_resolver" priority="40" />
        </service>

        <!-- Authentication related services -->
        <service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" />

        <service id="security.authentication.session_strategy" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy">
            <argument>%security.authentication.session_strategy.strategy%</argument>
        </service>
        <service id="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface" alias="security.authentication.session_strategy" />

        <service id="security.authentication.session_strategy_noop" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy" public="false">
            <argument>none</argument>
        </service>

        <service id="security.encoder_factory.generic" class="Symfony\Component\Security\Core\Encoder\EncoderFactory">
            <argument type="collection" />
        </service>

        <service id="security.encoder_factory" alias="security.encoder_factory.generic" />
        <service id="Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface" alias="security.encoder_factory" />

        <service id="security.user_password_encoder.generic" class="Symfony\Component\Security\Core\Encoder\UserPasswordEncoder">
            <argument type="service" id="security.encoder_factory"></argument>
        </service>

        <service id="security.password_encoder" alias="security.user_password_encoder.generic" public="true" />
        <service id="Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" alias="security.password_encoder" />

        <service id="security.user_checker" class="Symfony\Component\Security\Core\User\UserChecker" />

        <service id="security.expression_language" class="Symfony\Component\Security\Core\Authorization\ExpressionLanguage">
            <argument type="service" id="cache.security_expression_language" on-invalid="null" />
        </service>

        <service id="security.authentication_utils" class="Symfony\Component\Security\Http\Authentication\AuthenticationUtils" public="true">
            <argument type="service" id="request_stack" />
        </service>
        <service id="Symfony\Component\Security\Http\Authentication\AuthenticationUtils" alias="security.authentication_utils" />

        <service id="security.event_dispatcher.event_bubbling_listener" class="Symfony\Bundle\SecurityBundle\EventListener\FirewallEventBubblingListener" abstract="true">
            <argument type="service" id="event_dispatcher" />
        </service>

        <!-- Authorization related services -->
        <service id="security.access.decision_manager" class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager">
            <argument type="collection" />
        </service>
        <service id="Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface" alias="security.access.decision_manager" />

        <service id="security.role_hierarchy" class="Symfony\Component\Security\Core\Role\RoleHierarchy">
            <argument>%security.role_hierarchy.roles%</argument>
        </service>
        <service id="Symfony\Component\Security\Core\Role\RoleHierarchyInterface" alias="security.role_hierarchy" />

        <!-- Security Voters -->
        <service id="security.access.simple_role_voter" class="Symfony\Component\Security\Core\Authorization\Voter\RoleVoter">
            <tag name="security.voter" priority="245" />
        </service>

        <service id="security.access.authenticated_voter" class="Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter">
            <argument type="service" id="security.authentication.trust_resolver" />
            <tag name="security.voter" priority="250" />
        </service>

        <service id="security.access.role_hierarchy_voter" class="Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter">
            <argument type="service" id="security.role_hierarchy" />
            <tag name="security.voter" priority="245" />
        </service>

        <service id="security.access.expression_voter" class="Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter">
            <argument type="service" id="security.expression_language" />
            <argument type="service" id="security.authentication.trust_resolver" />
            <argument type="service" id="security.authorization_checker" />
            <argument type="service" id="security.role_hierarchy" on-invalid="null" />
            <tag name="security.voter" priority="245" />
        </service>


        <!-- Firewall related services -->
        <service id="security.firewall" class="Symfony\Bundle\SecurityBundle\EventListener\FirewallListener">
            <tag name="kernel.event_subscriber" />
            <argument type="service" id="security.firewall.map" />
            <argument type="service" id="event_dispatcher" />
            <argument type="service" id="security.logout_url_generator" />
        </service>
        <service id="Symfony\Component\Security\Http\Firewall" alias="security.firewall" />

        <service id="security.firewall.map" class="Symfony\Bundle\SecurityBundle\Security\FirewallMap">
            <argument /> <!-- Firewall context locator -->
            <argument /> <!-- Request matchers -->
        </service>

        <service id="security.firewall.context" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext" abstract="true">
            <argument type="collection" />
            <argument type="service" id="security.exception_listener" />
            <argument />  <!-- LogoutListener -->
            <argument />  <!-- FirewallConfig -->
        </service>

        <service id="security.firewall.lazy_context" class="Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext" abstract="true">
            <argument type="collection" />
            <argument type="service" id="security.exception_listener" />
            <argument />  <!-- LogoutListener -->
            <argument />  <!-- FirewallConfig -->
            <argument type="service" id="security.untracked_token_storage" />
        </service>

        <service id="security.firewall.config" class="Symfony\Bundle\SecurityBundle\Security\FirewallConfig" abstract="true">
            <argument />                   <!-- name -->
            <argument />                   <!-- user_checker -->
            <argument />                   <!-- request_matcher -->
            <argument>false</argument>     <!-- security enabled -->
            <argument>false</argument>     <!-- stateless -->
            <argument />                   <!-- provider -->
            <argument />                   <!-- context -->
            <argument />                   <!-- entry_point -->
            <argument />                   <!-- access_denied_handler -->
            <argument />                   <!-- access_denied_url -->
            <argument type="collection" /> <!-- listeners -->
            <argument>null</argument>      <!-- switch_user -->
        </service>

        <service id="security.logout_url_generator" class="Symfony\Component\Security\Http\Logout\LogoutUrlGenerator">
            <argument type="service" id="request_stack" on-invalid="null" />
            <argument type="service" id="router" on-invalid="null" />
            <argument type="service" id="security.token_storage" />
        </service>

        <!-- Provisioning -->
        <service id="security.user.provider.missing" class="Symfony\Component\Security\Core\User\MissingUserProvider" abstract="true">
            <argument /> <!-- firewall -->
        </service>

        <service id="security.user.provider.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" abstract="true" />

        <service id="security.user.provider.ldap" class="Symfony\Component\Ldap\Security\LdapUserProvider" abstract="true">
            <argument /> <!-- security.ldap.ldap -->
            <argument /> <!-- base dn -->
            <argument /> <!-- search dn -->
            <argument /> <!-- search password -->
            <argument /> <!-- default_roles -->
            <argument /> <!-- uid key -->
            <argument /> <!-- filter -->
            <argument /> <!-- password_attribute -->
            <argument /> <!-- extra_fields (email etc) -->
        </service>

        <service id="security.user.provider.chain" class="Symfony\Component\Security\Core\User\ChainUserProvider" abstract="true" />

        <service id="security.http_utils" class="Symfony\Component\Security\Http\HttpUtils">
            <argument type="service" id="router" on-invalid="null" />
            <argument type="service" id="router" on-invalid="null" />
        </service>
        <service id="Symfony\Component\Security\Http\HttpUtils" alias="security.http_utils" />


        <!-- Validator -->
        <service id="security.validator.user_password" class="Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator">
            <tag name="validator.constraint_validator" alias="security.validator.user_password" />
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="security.encoder_factory" />
        </service>

        <!-- Cache -->
        <service id="cache.security_expression_language" parent="cache.system" public="false">
            <tag name="cache.pool" />
        </service>

        <!-- Cache Warmers -->
        <service id="security.cache_warmer.expression" class="Symfony\Bundle\SecurityBundle\CacheWarmer\ExpressionCacheWarmer">
            <tag name="kernel.cache_warmer" />
            <argument type="collection" /> <!-- expressions -->
            <argument type="service" id="security.expression_language" />
        </service>
    </services>
</container>
